package com.example.clxy.dao;

import com.example.clxy.entity.Innovation;
import com.example.clxy.result.business.InnovationRemindResult;
import com.example.clxy.result.business.PageResult.InnovationUserFilePageResult;
import com.example.clxy.result.business.InnovationResult;
import com.example.clxy.result.business.PageResult.InnovationAdminPageResult;
import com.example.clxy.result.business.PageResult.InnovationStudentPageResult;
import com.example.clxy.result.business.StudentInnovationResult;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface InnovationMapper {
    int deleteByPrimaryKey(String innovationid);

    int insert(Innovation record);

    int insertSelective(Innovation record);

    Innovation selectByPrimaryKey(String innovationid);

    int updateByPrimaryKeySelective(Innovation record);

    int updateByPrimaryKey(Innovation record);
    int insertInnovationTeacher(@Param("innovationid") String innovationid,
                                @Param("teacherid") String teacherid);

    int deleteInnovation(String innovationid);

    int deleteInnovationTeacher(String innovationid);

    String getInnovationidByTeacherid(String teacherid);

    int withdrawInnovation(String innovationid);

    int approveInnovation(@Param("innovationid") String innovationid,
                          @Param("applystatus") String applystatus,
                          @Param("rejectreason") String rejectreason,
                          @Param("publishdate") Date publishdate);


    int withdrawInnovationStudent(@Param("innovationid") String innovationid,
                                  @Param("studentid") String studentid,
                                  @Param("withdrawreason") String withdrawreason);

    InnovationResult getInnovationById(String innovationid);

    List<InnovationAdminPageResult> getInnovationListByAdmin(@Param("innovationname") String innovationname,
                                                             @Param("applystatus") String applystatus,
                                                             @Param("begin") int begin,
                                                             @Param("end") int end,
                                                             @Param("pagesize") int pagesize);

    List<InnovationAdminPageResult> getInnovationListByTeacher(@Param("innovationname") String innovationname,
                                                               @Param("teacherid") String teacherid,
                                                               @Param("applystatus") String applystatus,
                                                               @Param("begin") int begin,
                                                               @Param("end") int end,
                                                               @Param("pagesize") int pagesize);

    List<InnovationAdminPageResult> getInnovationListByStudent(@Param("innovationname") String innovationname,
                                                               @Param("studentid") String studentid,
                                                               @Param("applystatus") String applystatus,
                                                               @Param("begin") int begin,
                                                               @Param("end") int end,
                                                               @Param("pagesize") int pagesize);

    int finishInnovationByTeacher(@Param("teacherid") String teacherid, @Param("innovationid") String innovationid);

    int applyInnovation(@Param("innovationid") String innovationid,
                        @Param("applydate") String applydate);

    List<InnovationAdminPageResult> getInnovationListToApply(@Param("innovationname") String innovationname,
                                                             @Param("studentid") String studentid,
                                                             @Param("begin") int begin,
                                                             @Param("end") int end,
                                                             @Param("pagesize") int pagesize);

    InnovationResult getInnovationByIdTeacher(@Param("innovationid") String innovationid, @Param("teacherid") String teacherid);

    StudentInnovationResult getInnovationByIdStudent(@Param("innovationid") String innovationid, @Param("studentid") String studentid);

    List<InnovationStudentPageResult> getStudentListByIdAndStatus(@Param("teacherid") String teacherid,
                                                                  @Param("innovationid") String innovationid,
                                                                  @Param("applystatus") String applystatus,
                                                                  @Param("begin") int begin,
                                                                  @Param("end") int end,
                                                                  @Param("pagesize") int pagesize);

    List<InnovationAdminPageResult> getInnovationListByStudentWeb(@Param("innovationname") String innovationname,
                                                                  @Param("studentid") String studentid,
                                                                  @Param("applystatus") String applystatus,
                                                                  @Param("begin") int begin,
                                                                  @Param("end") int end,
                                                                  @Param("pagesize") int pagesize);

    List<InnovationStudentPageResult> getStudentListByTeacherWeb(@Param("innovationname") String innovationname,
                                                                 @Param("teacherid") String teacherid,
                                                                 @Param("applystatus") String applystatus,
                                                                 @Param("begin") int begin,
                                                                 @Param("end") int end,
                                                                 @Param("pagesize") int pagesize);


    List<InnovationUserFilePageResult> getProjectfileList(@Param("innovationid") String innovationid,
                                                          @Param("begin") int begin,
                                                          @Param("end") int end,
                                                          @Param("pagesize") int pagesize);

    int deleteProjectfile(@Param("innovationid") String innovationid,
                          @Param("userid") String userid,
                          @Param("projectfilepath") String projectfilepath);

    List<InnovationRemindResult> getInnovationRemindByTeacher(@Param("teacherid") String teacherid,
                                                              @Param("begin") int begin,
                                                              @Param("end") int end,
                                                             @Param("pagesize") int pagesize);
}